#ifndef xpack_lang_cxx_is_ends_with
#define xpack_lang_cxx_is_ends_with
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::lang_cxx::inc
#include"define/base_type.hpp"
#include"lang/cxx.hpp"
#pragma pop_macro("xuser")

namespace mixc::lang_cxx{
    template<class item_t>
    inline bool cxx<item_t>::is_ends_with(item_cref_t value, invoke_compare_t compare) const {
        return xthe.is_ends_with(the_t(& value, 1), compare);
    }

    template<class item_t>
    inline bool cxx<item_t>::is_ends_with(the_cref_t value, invoke_compare_t compare) const {
        if (xthe->length < value->length or value->length == zero){
            return false;
        }

        auto backward   = xthe->length - value->length;
        auto new_main   = xthe.backward(backward);
        return new_main.compare(value, compare) == 0;
    }
}

#endif
